package com.system.config;

import java.util.Properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
/*
使用方法：getProperty的key为除prefix外的内容
@Autowired
@Qualifier("demoProperties")
private Properties demoProperties;
@Autowired
@Qualifier("demo1Properties")
private Properties demo1Properties;*/
@Component
public class PropertiesConfig {
	
	@ConfigurationProperties(locations = "classpath:config/demo.properties",prefix="demo")
	@Bean(name="demoProperties")
	public Properties  demoProperties(){
		return new Properties();
	}
	@ConfigurationProperties(locations = "classpath:config/demo1.properties",prefix="demo1")
	@Bean(name="demo1Properties")
	public Properties  demo1Properties(){
		return new Properties();
	}
	@ConfigurationProperties(locations = "classpath:config/db.properties",prefix="demo1")
	@Bean(name="dbProperties")
	public Properties  dbProperties(){
		return new Properties();
	}
	@ConfigurationProperties(locations = "classpath:config/portal.properties")
	@Bean(name="portalProperties")
	public Properties  portalProperties(){
		return new Properties();
	}
}
